package com.fourth.controller.api;

import com.fourth.service.UbAddrService;
import com.ljx.entity.Addr;
import com.ljx.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Mr.ma
 * @since 2023/3/6 14:22
 **/
@RestController
@RequestMapping("/detail/addr")
@Api("地址操作接口")
public class UbApiAddrController {

    @Resource
    private UbAddrService ubAddrService;

    @RequestMapping("getAllAddr")
    @ApiOperation("获取登录用户的所有地址")
    public Result<List<Addr>> getAllAddr(){
        List<Addr> userAddr = ubAddrService.getUserAddr();
        return new Result<>(2000,"查询成功",userAddr);
    }
}
